package cn.devcoder.cloudcode.coreservice;

import org.springframework.beans.BeanUtils;

import cn.devcoder.cloudcode.bean.UserBean;
import cn.devcoder.cloudcode.core.UserService;
import cn.devcoder.cloudcode.core.dto.UserObj;
import cn.devcoder.cloudcode.dao.UserDao;

public class UserServiceImpl implements UserService{
	private UserDao userDao;

	public int createUser(UserObj user) {
		UserBean userBean = new UserBean();
		BeanUtils.copyProperties(user, userBean);
		
		int id = userDao.save(userBean);
		return id;
	}

	public UserDao getUserDao() {
		return userDao;
	}

	public void setUserDao(UserDao userDao) {
		this.userDao = userDao;
	}
	
}
